var id = ''
export default{
	data() {
	   return {
			share:{
			   title: '免费发布各种便民信息，你想要的这里都有...',
			   desc:'你想要的，这里都有',
			   imageUrl:'',
			   path:'/pages/uni_Home?userId=' + id
			}
	   }
	},
	onShow(){
		if(uni.getStorageSync('userInfo')){
			id = uni.getStorageSync('userInfo').id
		}
	},
	onShareAppMessage(res) { //发送给朋友
		return {
			title: this.share.title,
			desc:this.share.desc,
			imageUrl: this.share.imageUrl,
			path:this.share.path,
		}
	},
	onShareTimeline(res) {//分享到朋友圈
		return {
			title: this.share.title,
			desc:this.share.desc,
			imageUrl: this.share.imageUrl,
			path:this.share.path
		}
	},
	 created() {
	        //#ifdef MP-WEIXIN
	        wx.showShareMenu({
	            withShareTicket: true,
	            menus: ['shareAppMessage', 'shareTimeline'],
				success: (res) => {
					// console.log('设置showShareMenu----success', res);
				},
				fail: () => {
					console.log('设置showShareMenu---fail');
				}
	        });
	        //#endif
			
	    },
}